package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.custom.AjaxResult;
import com.example.demo.custom.BaseController;
import com.example.demo.entity.TwoCompany;
import com.example.demo.form.TwoCompanyForm;
import com.example.demo.service.TwoCompanyService;

@RestController
@RequestMapping(value = "/twocompany")
public class TwoCompanyController extends BaseController<TwoCompany, Integer, TwoCompanyForm>{
	@Autowired
	private TwoCompanyService twocompany;
	
	@RequestMapping(value="/findbyId")
	public Object byId(TwoCompanyForm form) {
		TwoCompany model = null;
		Integer id = form.getId();
		if(id!=null) {
			 model = twocompany.findById(id);
		}	
		return new AjaxResult(model);	
	}

}
